| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import {chat_v1 as chatV1} from 'googleapis/build/src/apis/chat/v1'; |
||
| 18 | |||
| 19 | export default abstract class BaseCard implements Card { |
||
| 20 | private id: string = 'cardId'; |
||
| 21 | private _content: chatV1.Schema$GoogleAppsCardV1Section[] = []; |
||
| 22 | |||
| 23 | protected card: chatV1.Schema$GoogleAppsCardV1Card = { |
||
| 24 | sections: this._content, |
||
| 25 | }; |
||
| 26 | |||
| 27 | abstract buildSections(): void; |
||
| 28 | |||
| 29 | abstract create(): chatV1.Schema$GoogleAppsCardV1Card; |
||
| 30 | |||
| 31 | createCardWithId(): chatV1.Schema$CardWithId { |
||
| 32 | return { |
||
| 33 | 'cardId': this.id, |
||
| 34 | 'card': this.create(), |
||
| 35 | }; |
||
| 36 | } |
||
| 37 | |||
| 38 | createMessage(): chatV1.Schema$Message { |
||
| 39 | return {cardsV2: [this.createCardWithId()]}; |
||
| 40 | } |
||
| 42 |